<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
 <script>
  let arr =[];
  for(let i = 1;i<=20;i++){
      function f(i){
          if (i == 1 || i == 2){
              return 1;
          }
          return f(i-1)+f(i-2)
      }
      //将f(i)方法元素，添加到arr数组尾部
      arr.push(f(i))
      console.log(f(i))
  }
   document.write(arr);

 </script>
</body>
</html>